package com.ruoyi.project.er.enums;

import java.util.HashMap;
import java.util.Map;

public enum PaeaErrorStatus {
	Registered(100, "登记未发布"), Published(200, "登记已发布"),
	Certified(400, "确认差错"),AutoFinished(600, "自动归档"), Finished(800, "确认结束");

	public static PaeaErrorStatus toPaeaErrorStatus(Integer value) {
		return codeMap.get(value);
	}
	public static String getNameByCode(Integer value) {
		PaeaErrorStatus status = codeMap.get(value);
		if (status != null) {
			return status.getName();
		}
		return "未知状态";
	}
	private static Map<Integer, PaeaErrorStatus> codeMap;
	private static Map<String, PaeaErrorStatus> nameMap;
	static {
		codeMap = new HashMap<Integer, PaeaErrorStatus>();
		nameMap = new HashMap<String, PaeaErrorStatus>();
		for (PaeaErrorStatus status : PaeaErrorStatus.values()) {
			codeMap.put(status.getValue(), status);
			nameMap.put(status.getName(), status);
		}
	}
	private Integer value;
	private String name;

	private PaeaErrorStatus(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}

	public String toString() {
		return this.getValue() + "-" + this.getName();
	}

	public static void main(String[] args) {
		for (PaeaErrorStatus status : PaeaErrorStatus.values()) {
			System.out.println(status);
		}
	}
}
